import javax.swing.*;
import java.awt.*;

public class FourthWindow {

    static TextArea detailsTextArea;
    static StringBuilder detailsBuilder;
    public void Window4() {


        // 创建第四个窗口
        JFrame fourthFrame = new JFrame("收支明细");
        fourthFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        fourthFrame.setLayout(new BorderLayout());

        // 创建组件
        detailsTextArea = new TextArea();
        detailsTextArea.setEditable(false);
        JScrollPane scrollPane = new JScrollPane(detailsTextArea);

        // 拼接收支明细内容
        detailsBuilder = new StringBuilder();
        detailsBuilder.append("日期\t收入/支出\t金额\t\t\t\t收入/支出原因\n");

        // 将组件添加到第四个窗口
        fourthFrame.add(scrollPane, BorderLayout.CENTER);

        // 显示第四个窗口
        fourthFrame.setSize(500, 400);
        fourthFrame.setVisible(true);
    }
}
